#!/usr/bin/env python
# coding=utf-8
# __author__ = 'Yunchao Ling'

import os

parentpath = "/local/home/dataadmin/plant_gene/Plants_fasta"
for file in os.listdir(parentpath):
    abspath = os.path.join(parentpath, file)
    infile = open(abspath, "r")
    for line in infile:
        line = line.rstrip()
        if line.startswith(">"):
            id = line.split(" ")[0][1:]
            if id.find(".") == -1:
                print(file + "|" + id)
    infile.close()
